package com.liu.epidemic.mapper;

import com.liu.epidemic.bean.UserInfo;
import org.apache.ibatis.annotations.*;

/**
 * @author liucong
 * @date 2020/11/13 - 10:50
 */
@Mapper
public interface UserMapper {
    //@Select(value= {"",""})
    @Select("select * from users where account=#{account} and password=#{password}")
    UserInfo login(UserInfo userInfo);

    @Insert("INSERT INTO users(account,password,user_name) VALUES(#{account},#{password},#{userName})")
    void userInput(UserInfo userInfo);

    @Select("select * from users where account=#{account}")
    UserInfo queryUserByAccount(@Param("account") String account);

    @Update("UPDATE users SET account=#{account} , password=#{password} , user_name=#{userName} WHERE user_id=#{userId};")
    int updateUser(UserInfo userInfo);
}
